import { useI18n } from '/@/hooks/web/useI18n';
import { BasicColumn, BasicTableProps, FormProps } from '/@/components/Table';
import { ftdsDebtorManagementListData } from '/@/api/operating/ftdsDebtorManagement';

const { t } = useI18n('sys.ftdsDebtorManagement');

const modalProps = {
  title: t('债务人管理选择'),
};

const searchForm: FormProps = {
  baseColProps: { lg: 6, md: 8 },
  labelWidth: 90,
  schemas: [
    {
      label: t('所属甲方'),
      field: 'managementSsjf',
      component: 'Input',
    },
    {
      label: t('平台方'),
      field: 'managementPtf',
      component: 'Input',
    },
    {
      label: t('处置方'),
      field: 'managementCzf',
      component: 'Input',
    },
    {
      label: t('处置方式'),
      field: 'managementCzfs',
      component: 'Input',
    },
    {
      label: t('委案日期'),
      field: 'managementWarq',
      component: 'Input',
    },
    {
      label: t('债务人姓名'),
      field: 'managementZwrxm',
      component: 'Input',
    },
    {
      label: t('身份证号码'),
      field: 'managementSfzhm',
      component: 'Input',
    },
    {
      label: t('出生日期'),
      field: 'managementCsrq',
      component: 'Input',
    },
    {
      label: t('手机号码'),
      field: 'managementSjhm',
      component: 'Input',
    },
    {
      label: t('身份证地址'),
      field: 'managementSfzdz',
      component: 'Input',
    },
    {
      label: t('民族'),
      field: 'managementMz',
      component: 'Input',
    },
    {
      label: t('性别'),
      field: 'managementXb',
      component: 'Input',
    },
    {
      label: t('法院'),
      field: 'managementFy',
      component: 'Input',
    },
    {
      label: t('共债数量'),
      field: 'managementGzsl',
      component: 'Input',
    },
    {
      label: t('总逾期本金'),
      field: 'managementZyqbj',
      component: 'Input',
    },
    {
      label: t('总逾期利息'),
      field: 'managementZyqlx',
      component: 'Input',
    },
    {
      label: t('总逾期罚息'),
      field: 'managementZyqfx',
      component: 'Input',
    },
    {
      label: t('负责人'),
      field: 'managementFzr',
      component: 'Input',
    },
    {
      label: t('是否有新订单'),
      field: 'managementSfyxdd',
      component: 'Input',
    },
    {
      label: t('还款状态'),
      field: 'managementHkzt',
      component: 'Input',
    },
  ],
};

const tableColumns: BasicColumn[] = [
  {
    title: t('所属甲方'),
    dataIndex: 'managementSsjf',
    key: 'a.management_ssjf',
    sorter: true,
    width: 230,
    align: 'left',
    slot: 'firstColumn',
  },
  {
    title: t('平台方'),
    dataIndex: 'managementPtf',
    key: 'a.management_ptf',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('处置方'),
    dataIndex: 'managementCzf',
    key: 'a.management_czf',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('处置方式'),
    dataIndex: 'managementCzfs',
    key: 'a.management_czfs',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('委案日期'),
    dataIndex: 'managementWarq',
    key: 'a.management_warq',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('债务人姓名'),
    dataIndex: 'managementZwrxm',
    key: 'a.management_zwrxm',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('身份证号码'),
    dataIndex: 'managementSfzhm',
    key: 'a.management_sfzhm',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('出生日期'),
    dataIndex: 'managementCsrq',
    key: 'a.management_csrq',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('手机号码'),
    dataIndex: 'managementSjhm',
    key: 'a.management_sjhm',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('身份证地址'),
    dataIndex: 'managementSfzdz',
    key: 'a.management_sfzdz',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('民族'),
    dataIndex: 'managementMz',
    key: 'a.management_mz',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('性别'),
    dataIndex: 'managementXb',
    key: 'a.management_xb',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('法院'),
    dataIndex: 'managementFy',
    key: 'a.management_fy',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('共债数量'),
    dataIndex: 'managementGzsl',
    key: 'a.management_gzsl',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('总逾期本金'),
    dataIndex: 'managementZyqbj',
    key: 'a.management_zyqbj',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('总逾期利息'),
    dataIndex: 'managementZyqlx',
    key: 'a.management_zyqlx',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('总逾期罚息'),
    dataIndex: 'managementZyqfx',
    key: 'a.management_zyqfx',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('负责人'),
    dataIndex: 'managementFzr',
    key: 'a.management_fzr',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('是否有新订单'),
    dataIndex: 'managementSfyxdd',
    key: 'a.management_sfyxdd',
    sorter: true,
    width: 130,
    align: 'left',
  },
  {
    title: t('还款状态'),
    dataIndex: 'managementHkzt',
    key: 'a.management_hkzt',
    sorter: true,
    width: 130,
    align: 'left',
  },
];

const tableProps: BasicTableProps = {
  api: ftdsDebtorManagementListData,
  beforeFetch: (params) => {
    params['isAll'] = true;
    return params;
  },
  columns: tableColumns,
  formConfig: searchForm,
  rowKey: 'id',
};

export default {
  modalProps,
  tableProps,
  itemCode: 'id',
  itemName: 'id',
  isShowCode: false,
};
